package vip.sweet.biz.modular.product.service.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import vip.sweet.biz.modular.product.entity.BizProductMaterials;
import vip.sweet.biz.modular.product.mapper.BizProductMaterialsMapper;
import vip.sweet.biz.modular.product.params.BizProductMaterialsAddParams;
import vip.sweet.biz.modular.product.service.BizProductMaterialsService;

/**
 * @author ASUS
 * @Date 2025/10/5 11:38
 * @Descripition
 */
@Service
public class BizProductMaterialsServiceImpl extends ServiceImpl<BizProductMaterialsMapper, BizProductMaterials> implements BizProductMaterialsService {
    @Override
    public boolean add(BizProductMaterialsAddParams bizProductMaterialsAddParams) {
        if (ObjectUtil.isNotEmpty(bizProductMaterialsAddParams))
            return save(BeanUtil.toBean(bizProductMaterialsAddParams, BizProductMaterials.class));
        return false;
    }
}
